<style lang="less">
</style>

<template>
  <div>
    <el-button type="primary" size="small" v-if='btnConfig.edit' @click='goPage("editNotice", scope.row.uuid)'>编辑</el-button>
    <el-button type="primary"  size="small" :disabled="publishDisabled" v-if='btnConfig.publish' @click='showPublishBox(scope.row)'>推送</el-button>

  </div>
  
</template>

<script>
  export default {
    props:{
      scope:{
        type:Object,
        required:true,
      },
      btnConfig:{
        type:Object,
        default:()=> {return {}},
      }
    },
    computed:{
      publishDisabled(){
        let cont = this.scope.row
				let result =  cont.status =='DRAFT' ||  (cont.pushLiCaiShiResult && cont.pushLiCaiShiResult.trim() =="理财师推送成功" &&  cont.pushHuaCaiTongResult && cont.pushHuaCaiTongResult.trim() == '华财通推送成功')
				return result
			},
    },
    methods:{
      showPublishBox(obj){
        if(obj.status !='DRAFT'){
          this.$emit('showPublishBox', obj)
        }

      },
      goPage(name,id){
        console.log(name,id)
        this.$router.push({
          name:name,
          query:{
            id:id
          }
        })
      }

    },
    created(){
    }
  }
</script>
